<template>
  <div class="comparison">
    <div class="table">
      <el-table border style="width: 100%" :header-cell-style="{
          background: '#0070C0',
          color: '#ffffff',
        }" :data="tableData">
        <el-table-column label="环比下降支局TOP100" prop="incomeName1" align="center">
          <el-table-column label="分局" prop="areaName" align="center"></el-table-column>
          <el-table-column label="支局" prop="displayName" align="center"></el-table-column>
          <el-table-column label="环比下降(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{scope.row.hb}}</span>
              <span v-else>{{scope.row.hb}}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <!-- <el-table border style="width: 100%" :header-cell-style="{
          background: '#0070C0',
          color: '#ffffff',
        }" :data="tableData1">
        <el-table-column label="环比下降支局TOP10(二类综合支局)" prop="incomeName1" align="center">
          <el-table-column label="分局" prop="areaName" align="center"></el-table-column>
          <el-table-column label="支局" prop="displayName" align="center"></el-table-column>
          <el-table-column label="环比下降(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{scope.row.hb}}</span>
              <span v-else>{{scope.row.hb}}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table border style="width: 100%" :header-cell-style="{
          background: '#0070C0',
          color: '#ffffff',
        }" :data="tableData2">
        <el-table-column label="环比下降支局TOP10(三类综合支局)" prop="incomeName1" align="center">
          <el-table-column label="分局" prop="areaName" align="center"></el-table-column>
          <el-table-column label="支局" prop="displayName" align="center"></el-table-column>
          <el-table-column label="环比下降(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{scope.row.hb}}</span>
              <span v-else>{{scope.row.hb}}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table border style="width: 100%" :header-cell-style="{
          background: '#0070C0',
          color: '#ffffff',
        }" :data="tableData3">
        <el-table-column label="环比下降支局TOP10(一类政企支局)" prop="incomeName1" align="center">
          <el-table-column label="分局" prop="areaName" align="center"></el-table-column>
          <el-table-column label="支局" prop="displayName" align="center"></el-table-column>
          <el-table-column label="环比下降(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{scope.row.hb}}</span>
              <span v-else>{{scope.row.hb}}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table border style="width: 100%" :header-cell-style="{
          background: '#0070C0',
          color: '#ffffff',
        }" :data="tableData4">
        <el-table-column label="环比下降支局TOP10(二类政企支局)" prop="incomeName1" align="center">
          <el-table-column label="分局" prop="areaName" align="center"></el-table-column>
          <el-table-column label="支局" prop="displayName" align="center"></el-table-column>
          <el-table-column label="环比下降(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{scope.row.hb}}</span>
              <span v-else>{{scope.row.hb}}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table> -->
    </div>
  </div>
</template>

<script>
// import { substation } from "@/api/barCode/index";

import $barCodeApi from "@/api/barCode/index";

export default {
  name: "comparison",
  components: {},
  props: {
    form: {
      type: Object,
      default: {},
    },
  },
  data () {
    return {
      tableData: [],
      tableData1: [],
      tableData2: [],
      tableData3: [],
      tableData4: [],
    };
  },
  created () { },
  mounted () {

  },
  methods: {
    getList () {


      $barCodeApi.substation({
        acctMonth: this.form.acctMonth,
        areaId: this.form.areaId,
        type: '2'
      }, res => {
        if (res.code == 0) {
          this.tableData = res.content.一类综合;
          // this.tableData1 = res.data.二类综合;
          // this.tableData2 = res.data.三类综合;
          // this.tableData3 = res.data.一类政企;
          // this.tableData4 = res.data.二类政企;
        }
      });





      // substation({
      //   acctMonth: this.form.acctMonth,
      //   type: '2'
      // }).then((res) => {
      //   if (res.code == 0) {
      //     this.tableData = res.data.一类综合;
      //     this.tableData1 = res.data.二类综合;
      //     this.tableData2 = res.data.三类综合;
      //     this.tableData3 = res.data.一类政企;
      //     this.tableData4 = res.data.二类政企;
      //   }
      // });
    },
  },
};
</script>

<style scoped lang="scss">
.table {
  display: flex;
}
</style>
